Skip to content

Implement scalable grouped-question pages#78

Merged
simonwhatley merged 18 commits into
mainfrom
919-reorganise-flow
May 22, 2026
Merged

Implement scalable grouped-question pages#78
simonwhatley merged 18 commits into
mainfrom
919-reorganise-flow

Conversation

@simonwhatley
Copy link
Copy Markdown
Collaborator

@simonwhatley simonwhatley commented May 21, 2026

Implemented scalable grouped-question pages for prototype_v4_2.

View prototype: https://lung-health-check-pr-78.herokuapp.com/

Changes include:

  • Added pages.yaml as the source for page-level content and composition:
    • page heading and optional caption
    • description/details
    • ordered list of question IDs
    • conditional question display via if, includes, excludes, any, and all
  • Kept questions.yaml focused on reusable question controls:
    • type
    • answerKey
    • input.label
    • hints, options, validation, errors and summary labels
  • Added support for caption-only page headings, so a page can use a question label as the H1 while setting its own caption.
  • Added grouped-page infrastructure:
    • page loader in lib/question-pages.js
    • renderQuestionPage()
    • validateQuestions()
    • shared _question-input.html partial
    • grouped _question-page.html template
  • Added and wired grouped pages:
    • /about-you
    • /asbestos
    • /smoking-duration
    • /tobacco-smoking
    • /tobacco-smoking-change
  • Updated flow so:
    • weight pages continue to /about-you
    • /about-you continues to respiratory conditions
    • respiratory conditions continue to grouped /asbestos
    • smoking-duration replaces age-started-smoking, age-stopped-smoking, and periods-stopped-smoking
    • tobacco-smoking replaces separate frequency and quantity pages
    • tobacco-smoking-change replaces separate change frequency, quantity, and years pages
    • shisha follows the same tobacco-smoking flow but skips the smoking-change flow
  • Removed unused standalone pages, routes and controllers for:
    • asbestos at work/home pages, now combined into /asbestos
    • cancer history
    • individual smoking duration pages
    • individual tobacco frequency/quantity/change pages
    • old shisha smoking-setting flow and related summary/seed/docs content
  • Updated check-your-answers links so grouped answers change via their grouped pages:
    • gender, sex, ethnicity, education -> /about-you
    • asbestos answers -> /asbestos
    • smoking duration answers -> /smoking-duration
    • tobacco smoking answers -> grouped tobacco pages
  • Cleaned up YAML by moving labels into input.label, removing empty input: {} blocks, and reducing avoidable quoted scalar values.
  • Updated docs and index links:
    • question-schema.md
    • question-flow.md
    • tobacco docs
    • prototype page index

@simonwhatley simonwhatley temporarily deployed to lung-health-check-pr-78 May 21, 2026 17:11 Inactive
@simonwhatley simonwhatley changed the title Reorganise prototype flow Implement scalable grouped-question pages May 22, 2026
@simonwhatley simonwhatley merged commit 4cd7bd7 into main May 22, 2026
1 check passed
@simonwhatley simonwhatley deleted the 919-reorganise-flow branch May 22, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant